home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / pcl / src-16f.lha / compiler / sparc / print.lisp < prev    next >
Encoding:
Text File  |  1991-11-06  |  1.5 KB  |  42 lines

  1. ;;; -*- Package: SPARC -*-
  2. ;;;
  3. ;;; **********************************************************************
  4. ;;; This code was written as part of the Spice Lisp project at
  5. ;;; Carnegie-Mellon University, and has been placed in the public domain.
  6. ;;; If you want to use this code or any part of Spice Lisp, please contact
  7. ;;; Scott Fahlman (FAHLMAN@CMUC). 
  8. ;;; **********************************************************************
  9. ;;;
  10. ;;; $Header: print.lisp,v 1.1 90/11/30 17:05:00 wlott Exp $
  11. ;;;
  12. ;;; This file contains VOPs for things like printing during %initial-function
  13. ;;; before the world is initialized.
  14. ;;;
  15. ;;; Written by William Lott.
  16.  
  17. (in-package "SPARC")
  18.  
  19.  
  20. (define-vop (print)
  21.   (:args (object :scs (descriptor-reg any-reg) :target nl0))
  22.   (:results (result :scs (descriptor-reg)))
  23.   (:save-p t)
  24.   (:temporary (:sc any-reg :offset nl0-offset :from (:argument 0)) nl0)
  25.   (:temporary (:sc any-reg :offset cfunc-offset) cfunc)
  26.   (:temporary (:sc interior-reg :offset lip-offset) lip)
  27.   (:temporary (:scs (non-descriptor-reg)) temp)
  28.   (:temporary (:sc control-stack :offset nfp-save-offset) nfp-save)
  29.   (:vop-var vop)
  30.   (:generator 100
  31.     (let ((cur-nfp (current-nfp-tn vop)))
  32.       (when cur-nfp
  33.     (store-stack-tn nfp-save cur-nfp))
  34.       (move nl0 object)
  35.       (inst li cfunc (make-fixup "_debug_print" :foreign))
  36.       (inst li temp (make-fixup "_call_into_c" :foreign))
  37.       (inst jal lip temp)
  38.       (inst nop)
  39.       (when cur-nfp
  40.     (load-stack-tn cur-nfp nfp-save))
  41.       (move result nl0))))
  42.